class Solution(object):
    def addRungs(self, rungs, dist):
        n = len(rungs)
        if rungs[0] > dist:
            ans = (rungs[0] - 1) // dist
        else:
            ans = 0
        for i in range(1, n):
            if rungs[i] - rungs[i - 1] > dist:
                c = (rungs[i] - rungs[i - 1] - 1) // dist
                ans += c
        return ans


